﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Controles_Turno : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)BindCBO();
    }

    public string Value {
        set { ddlTurno.SelectedValue = value; }
        get { return ddlTurno.SelectedValue; }
    }
    private void BindCBO() {
        DataTable table = SchoolsBI.TipoTurno.Tabla();
        DataRow dr;
        dr = table.NewRow();
        dr[0] = "-1";
        dr[1] = "Seleccione...";
        table.Rows.InsertAt(dr, 0);

        ddlTurno.DataSource = table;
        ddlTurno.DataTextField = "Detalle";
        ddlTurno.DataValueField = "IdTurno";
        ddlTurno.DataBind();

    }
}
